/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.mess.entity;

import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.DataEntity;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 菜谱管理Entity
 * @author dby
 * @version 2020-08-20
 */
public class MessHall extends DataEntity<MessHall> {
	
	private static final long serialVersionUID = 1L;
	private Integer breakfast;		// 早餐
	private Integer lunch;		// 午餐
	private Integer dinner;		// 晚餐
	private Integer fruit;		// 水果
	private Integer snock;		// 加餐
	private Integer status;		// 启用状态 0=不可用 1=可用
	private String sort;		// 排序
	private Date planDate;
	private List<MessHall> messHallList;
	private List<Date> dateList;
	private List<Map<String,String>> dates;

	private Map<String, String> categoryMap;



	public MessHall() {
		super();
	}

	public MessHall(String id){
		super(id);
	}

	public List<MessHall> getMessHallList() {
		return messHallList;
	}

	public void setMessHallList(List<MessHall> messHallList) {
		this.messHallList = messHallList;
	}

	public Integer getBreakfast() { return breakfast; }

	public void setBreakfast(Integer breakfast) {
		this.breakfast = breakfast;
	}
	
	public Integer getLunch() {
		return lunch;
	}

	public void setLunch(Integer lunch) {
		this.lunch = lunch;
	}
	
	public Integer getDinner() {
		return dinner;
	}

	public void setDinner(Integer dinner) {
		this.dinner = dinner;
	}
	
	public Integer getFruit() {
		return fruit;
	}

	public void setFruit(Integer fruit) {
		this.fruit = fruit;
	}
	
	public Integer getSnock() {
		return snock;
	}

	public void setSnock(Integer snock) {
		this.snock = snock;
	}
	
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@Length(min=0, max=4, message="排序长度必须介于 0 和 4 之间")
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}


	public Date getPlanDate() {
		return planDate;
	}

	public void setPlanDate(Date planDate) {
		this.planDate = planDate;
	}

	public List<Date> getDateList() {
		return dateList;
	}

	public void setDateList(List<Date> dateList) {
		this.dateList = dateList;
	}

	public Map<String, String> getCategoryMap() {
		return categoryMap;
	}

	public void setCategoryMap(Map<String, String> categoryMap) {
		this.categoryMap = categoryMap;
	}

	public List<Map<String, String>> getDates() {
		return dates;
	}

	public void setDates(List<Map<String, String>> dates) {
		this.dates = dates;
	}

	public Integer fetchMealByCode(String code){
		switch (code){
			case "breakfast":return getBreakfast();
			case "lunch":return getLunch();
			case "dinner":return getDinner();
			case "fruit":return getFruit();
			case "snock":return getSnock();
			default:return null;
		}
	}
}